﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Generic;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using FutureOpen.Web.Pages;
using FutureOpen.Core;
using FutureOpen.Core.func;
using FutureOpen.Core.func.db;
using System.Text;

public partial class OrgView : PageBase
{
    public int oid;
    public string title;
    MyArt myart = new MyArt();
    protected void Page_Load(object sender, EventArgs e)
    {
        base.PageInit();
        oid = orgid;
        title = "查看组织";
        if (!IsPostBack)
        {              
            if (orgid > 0)
            {                      
                AspNetPager1.RecordCount = myart.GetArtCountByOrgID(orgid);
                BindArts(0, 25);
                
            }
            
        }

    }
     private void BindArts(int start, int count)
    {                
        System.Collections.Generic.IList<Art> artList = myart.GetArtByOrg(orgid, start, count);

        this.GridView_OrgArtList.DataSource = artList;
        this.GridView_OrgArtList.DataBind();
    }

    protected void AspNetPager1_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
    {
        AspNetPager1.CurrentPageIndex = e.NewPageIndex;
        BindArts(25 * (e.NewPageIndex - 1), 25);
    }
    protected void btnNew_Click(object sender, EventArgs e)
    {
        string url = "OrgArtNew.aspx?orgid=" + this.orgid;
        Response.Redirect(url);
    }
    protected void btnFresh_Click(object sender, EventArgs e)
    {
        BindArts(10 * (AspNetPager1.CurrentPageIndex - 1), 10);       
    }
    protected void btnFrontPage_Click(object sender, EventArgs e)
    {
        string url = "OrgView.aspx?orgid=" + this.orgid;
        Response.Redirect(url);
    }    
}
